<template>
  <div class="tag-item">
    <div class="tag-group" v-for="item in tagList">
      <span class="tag-name" :class="{'tag-name-agree': item.likeUp == 0}">{{item.tagName}}</span><span class="tag-agree" :class="{'tag-agree-agree': item.likeUp == 0}" @click="agree(item)">{{item.likeCount}}</span>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {

      }
    },
    props: {
      tagList: Array
    },
    methods: {
      agree(item) {
        this.$emit('tag-agree', item)
      }
    },
    mounted() {

    }
  }
</script>

<style scoped lang="scss">
  .tag-group {
    display: inline-block;
    height: 30px;
    user-select: none;
    margin-left: 10px;
    margin-top: 10px;
    .tag-name {
      display: inline-block;
      text-align: center;
      min-width: 80px;
      line-height: 30px;
      padding: 0 10px;
      font-size: 12px;
      color: #333;
      background: #c1e7fe;
      border-top-left-radius: 4px;
      border-bottom-left-radius: 4px;
    }
    .tag-agree {
      cursor: pointer;
      display: inline-block;
      width: 30px;
      text-align: center;
      line-height: 30px;
      background: #0090e9;
      font-size: 12px;
      color: #fff;
      border-bottom-right-radius: 4px;
      border-top-right-radius: 4px;
    }
    .tag-name-agree {
      background: #ebeced;
    }
    .tag-agree-agree {
      background: #b7b7b8;
    }
  }
</style>
